<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Data-Table 表格</title>
    <link rel="stylesheet" href="__STATIC__/frame/layui/css/layui.css">
    <!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
    <link rel="stylesheet" href="__STATIC__/frame/static/css/style.css">
    <link rel="icon" href="__STATIC__/frame/static/image/code.png">
</head>
<body class="body">

<!-- 工具集 -->
<div class="my-btn-box">
    <span class="fl">
        <a class="layui-btn layui-btn-danger radius btn-delect">删除只用将提现点设置成0即可</a>
        <a class="layui-btn btn-add btn-default" id="btn-add" data-href="{:url('index/create_tixiandian')}">添加</a>
        <a class="layui-btn btn-add btn-default" id="btn-refresh"><i class="layui-icon">&#x1002;</i></a>
    </span>
    <span class="fr">
        <span class="layui-form-label">搜索条件：</span>
        <form action="{:url('index/classification')}" method="post">
        <div class="layui-input-inline">
            <input type="text" name="tiaojian" autocomplete="off" placeholder="请输入搜索条件" {if $tiaojian}value="{$tiaojian}"{/if} class="layui-input">
        </div>
        <button class="layui-btn mgl-20">查询</button>
        </form>
    </span>
</div>

<!-- 表格 -->
<div class="layui-row">
<table class="layui-table" style="width: 100%">
    <thead>
    <tr style="width: 100%">
        <th style="width: 1%;text-align: center">ID</th>
        <th style="text-align: center">课程一级分类</th>
        <th style="text-align: center">课程二级分类</th>
        <th style="text-align: center">课程三级分类</th>
        <th style="text-align: center">获取的体现点数</th>
        <th style="text-align: center">操作</th>
    </tr>
    </thead>
    <tbody>
    {foreach $data as $value}
    <tr>
        <td style="text-align: center"><input type="checkbox" value="{$value['id']}"></td>
        <td style="text-align: center">{$value['class_name']}</td>
        <td style="text-align: center">{$value['branch_name']}</td>
        <td style="text-align: center">{$value['three_level_name']}</td>
        <td style="text-align: center">{$value['spot']}</td>
        <td style="text-align: center"><a href="javascript:;" onclick="edit({$value['id']})"><i class="layui-icon">&#xe642;</i></a></td>
    </tr>
    {/foreach}
    </tbody>
</table>
</div>
<script type="text/javascript" src="__STATIC__/frame/layui/layui.all.js"></script>
<script type="text/javascript" src="__STATIC__/js/index.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.3.3.1.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/maowenke.js"></script>
<!-- 表格操作按钮集 -->
<script>
    $("#btn-add").click(function () {
        var $html = $(this).attr('data-href');
        layer.open({ type: 2,
            title:'添加提现点科目',
            skin: 'layui-layer-rim', //加上边框
            area: ['500px', '500px'], //宽高
            content: $html,
            end:function () {
                window.location.reload();
            }
        });
    });
    $("#btn-refresh").click(function () {
        window.location.reload();
    });
    function edit($id) {
        layer.open({ type: 2,
            title:'修改当前三级分类的提现点',
            skin: 'layui-layer-rim', //加上边框
            area: ['300px', '500px'], //宽高
            content: "{:url('index/edit_tixiandian')}?id="+$id,
            end:function () {
                window.location.reload();
            }
        });
    }
</script>
</body>
</html>